Enable CMCD in Players
Enable CMCD in dash.js
Add the following code to your player application:
const player = dashjs.MediaPlayer().create();
player.updateSettings({
streaming: {
cmcd: {
enabled: true,
mode: "header",
enabledKeys: ["bs", "su", "rtp", "mtp", "tb", "br", "bl", "dl", "ot", "st", "sf", "pr", "d", "v"],
},
},
});
player.initialize(videoElement, mpdUrl, true);
Enable CMCD in Shaka Player
Add the following code to your player application:
const player = new shaka.Player(videoElement);
player.configure({
cmcd: {
enabled: true,
useHeaders: true,
version: 1,
includeKeys: ["bs", "su", "rtp", "mtp", "tb", "br", "bl", "dl", "ot", "st", "sf", "pr", "d", "v"],
},
});
player.load(manifestUri);
Enable CMCD in hls.js
Add the following code to your player application:
const hls = new Hls({
cmcd: {
useHeaders: true,
includeKeys: ["bs", "su", "rtp", "mtp", "tb", "br", "bl", "dl", "ot", "st", "sf", "pr", "d", "v"],
},
});
hls.loadSource("https://example.com/stream.m3u8");
hls.attachMedia(videoElement);